

      <!-- Begin page content -->
 <div class="container">
     <div id="orders">
     <div class="page-header" style="position:relative;">  
      	<h3>Orders</h3>
     </div>
		<?php
		if(empty($hasil)){
				echo "<table class='table table-striped'>
						<thead>
							<tr>
								<td>Order Code</td>
								<td>Order Id</td>
								<td>Customer</td>
								<td>Order Status</td>
                    			<td>Payment Status</td>
								<td>Total</td>
								<td>Date Add</td>
								<td>Date Modified</td>
							</tr>
						  </thead>
					</table>";
		}else{
		?>
      	<table class="table table-striped">
            <thead>
                <tr>
                    <td width="1" style="text-align: center;"><input name="checkbox[]" id="checkbox[]" class="chk_boxes" type="checkbox" value="" /></td>
                    <td>Order Code</td>
                  	<td>Order Id</td>
                  	<td>Customer</td>
                  	<td>Order Status</td>
                    <td>Payment Status</td>
                  	<td>Total</td>
                  	<td>Date Add</td>
                  	<td>Date Modified</td>
                  	<td>Action</td>	
                </tr>
			</thead>              
				<?php foreach ($hasil as $row): ?>
        		<tr>
                	<td width="1" style="text-align: center;"><input name="checkbox[]" id="checkbox[]" class="chk_boxes1" type="checkbox" value="$row -> order_id" /></td>
                	<td> <?php echo $row->order_cid; ?></td>
                    <td> <?php echo $row->order_id; ?></td>
                	<td> <?php echo $row->firstname; ?> <?php echo $row->lastname ?> </td>
                	<?php $order_status = $this->order_model->get_order_status(); ?>
                	<?php foreach ($order_status as $status){?>
                		<?php if ($status->order_status_id == $row->order_status_id) {?>
                			<td> <?php echo $status->name;?> </td>
                		<?php } ?>
                	<?php } ?>
                    <?php $status_payment = $this->order_model->get_status_payment() ?>
                    <?php foreach ($status_payment as $pay){ ?>
                    	<?php if($pay->payment_status_id == $row->payment_status_id){ ?>
                        	<td><?php echo $pay->name; ?></td>
                        <?php } ?>
                    <?php } ?>
                	<td> <?php echo number_format($row->total);?> </td>
                	<td> <?php echo $row->date_added;?> </td>
                	<td> <?php echo $row->date_modified?> </td>
                	<td> <a href="<?php echo site_url('order/info/'.$row->order_id);?>" title="View"><i class="icon-list-alt"></i></a>  <!--<a href="<?php echo site_url('order/update/'.$row->order_id);?>" title="Edit"><i class="icon-edit"></i></a>--></td>
                </tr>
				<?php endforeach; ?> 
		</table>
		<?php
        }
        ?>
        <center>
          <?php echo $pagination; ?>
        </center>
    </div>
</div>


        
        <script type="text/javascript" language="javascript">
			$(function() {
  				$('.chk_boxes').click(function(){
					var chk = $(this).attr('checked')?true:false;
					$('.chk_boxes1').attr('checked',chk);
				});
			});
		</script> 